<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <title>EntradaSaida Detail</title>
            <link rel="stylesheet" type="text/css" href="/globalimage2/faces/jsfcrud.css" /><%@ include file="/WEB-INF/jspf/AjaxScripts.jspf" %><script type="text/javascript" src="/globalimage2/faces/jsfcrud.js"></script>
        </head>
        <body>
            <%@include file="../../WEB-INF/jspf/header/head.jspf"%>
            <div style="float:left">
                <%@include file="../../WEB-INF/jspf/header/menuDinamico.jspf"%>
            </div>
            <div id="div_content">
                <h2>Detalhe do movimento</h2>
                <h:form>
                    <h:commandLink action="#{entradaSaida.editSetup}" value="Editar">
                        <f:param name="jsfcrud.currentEntradaSaida" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][entradaSaida.entradaSaida][entradaSaida.converter].jsfcrud_invoke}" />
                    </h:commandLink>
                    &nbsp;|&nbsp;
                    <h:commandLink action="#{entradaSaida.createSetup}" value="Novo" />
                    &nbsp;|&nbsp;
                    <h:commandLink action="#{entradaSaida.listSetup}" value="Exibir todos"/>

                    <h:panelGroup id="messagePanel" layout="block">
                        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                    </h:panelGroup>


                    <h:panelGrid columns="2">
                        <h:outputText value="Data da operacao:"/>
                        <h:outputText value="#{entradaSaida.entradaSaida.dataOperacao}" title="DataOperacao" >
                            <f:convertDateTime pattern="dd/MM/yyyy" />
                        </h:outputText>
                        <h:outputText value="Data do vencimento:"/>
                        <h:outputText value="#{entradaSaida.entradaSaida.dataVencimento}" title="DataVencimento" >
                            <f:convertDateTime pattern="dd/MM/yyyy" />
                        </h:outputText>
                        <h:outputText value="Parcela:"/>
                        <h:outputText value="#{entradaSaida.entradaSaida.parcelaAtual} de #{entradaSaida.entradaSaida.quantidadeParcela}" title="QuantidadeParcela" />
                        <h:outputText value="Valor:"/>
                        <h:outputText value="#{entradaSaida.entradaSaida.valor}" title="Valor" >
                            <f:convertNumber type="currency"/>
                        </h:outputText>
                        <c:if test="${not empty entradaSaida.entradaSaida.vendaCollection}">
                            <h:outputText value="Venda" />
                            <h:panelGroup>
                                <h:outputText rendered="#{empty entradaSaida.entradaSaida.vendaCollection}" value="(No Items)"/>
                                <h:dataTable value="#{entradaSaida.entradaSaida.vendaCollection}" var="item"
                                             border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px"
                                             rendered="#{not empty entradaSaida.entradaSaida.vendaCollection}">
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Vendedor"/>
                                        </f:facet>
                                        <h:outputText value="#{item.funcionarioId.usuarioId.nome}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Cliente"/>
                                        </f:facet>
                                        <h:outputText value="#{item.clienteId.nome}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Observacao"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.observacao}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Data"/>
                                        </f:facet>
                                        <h:outputText value="#{item.dataVenda}">
                                            <f:convertDateTime pattern="dd/MM/yyyy" />
                                        </h:outputText>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Data da entrega"/>
                                        </f:facet>
                                        <h:outputText value="#{item.dataEntrega}">
                                            <f:convertDateTime pattern="dd/MM/yyyy" />
                                        </h:outputText>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText escape="false" value="&nbsp;"/>
                                        </f:facet>
                                        <h:commandLink value="Exibir" action="#{venda.detailSetup}">
                                            <f:param name="jsfcrud.currentEntradaSaida" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][entradaSaida.entradaSaida][entradaSaida.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.currentVenda" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][venda.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.relatedController" value="entradaSaida" />
                                            <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.EntradaSaidaController" />
                                        </h:commandLink>
                                    </h:column>
                                </h:dataTable>
                            </h:panelGroup>
                        </c:if>
                        <c:if test="${not empty entradaSaida.entradaSaida.folhaPagamentoCollection}">
                            <h:outputText value="Folha de Pagamento:" />
                            <h:panelGroup>
                                <h:outputText rendered="#{empty entradaSaida.entradaSaida.folhaPagamentoCollection}" value="(No Items)"/>
                                <h:dataTable value="#{entradaSaida.entradaSaida.folhaPagamentoCollection}" var="item"
                                             border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px"
                                             rendered="#{not empty entradaSaida.entradaSaida.folhaPagamentoCollection}">
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="FolhaPagamentoId"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.folhaPagamentoId}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="DataPagamento"/>
                                        </f:facet>
                                        <h:outputText value="#{item.dataPagamento}">
                                            <f:convertDateTime pattern="MM/dd/yyyy" />
                                        </h:outputText>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Salario"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.salario}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Adiantamento"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.adiantamento}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Extra"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.extra}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="FuncionarioId"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.funcionarioId}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText escape="false" value="&nbsp;"/>
                                        </f:facet>
                                        <h:commandLink value="Exibir" action="#{folhaPagamento.detailSetup}">
                                            <f:param name="jsfcrud.currentEntradaSaida" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][entradaSaida.entradaSaida][entradaSaida.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.currentFolhaPagamento" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][folhaPagamento.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.relatedController" value="entradaSaida" />
                                            <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.EntradaSaidaController" />
                                        </h:commandLink>
                                        <h:outputText value=" "/>
                                        <h:commandLink value="Editar" action="#{folhaPagamento.editSetup}">
                                            <f:param name="jsfcrud.currentEntradaSaida" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][entradaSaida.entradaSaida][entradaSaida.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.currentFolhaPagamento" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][folhaPagamento.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.relatedController" value="entradaSaida" />
                                            <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.EntradaSaidaController" />
                                        </h:commandLink>
                                        <h:outputText value=" "/>
                                        <h:commandLink value="Remover" action="#{folhaPagamento.destroy}">
                                            <f:param name="jsfcrud.currentEntradaSaida" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][entradaSaida.entradaSaida][entradaSaida.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.currentFolhaPagamento" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][folhaPagamento.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.relatedController" value="entradaSaida" />
                                            <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.EntradaSaidaController" />
                                        </h:commandLink>
                                    </h:column>
                                </h:dataTable>
                            </h:panelGroup>
                        </c:if>
                        <c:if test="${not empty entradaSaida.entradaSaida.manutencaoCollection}">
                            <h:outputText value="Manutencao:" />
                            <h:panelGroup>
                                <h:outputText rendered="#{empty entradaSaida.entradaSaida.manutencaoCollection}" value="(No Items)"/>
                                <h:dataTable value="#{entradaSaida.entradaSaida.manutencaoCollection}" var="item"
                                             border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px"
                                             rendered="#{not empty entradaSaida.entradaSaida.manutencaoCollection}">
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="ManutencaoId"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.manutencaoId}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Observacao"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.observacao}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="DataChamado"/>
                                        </f:facet>
                                        <h:outputText value="#{item.dataChamado}">
                                            <f:convertDateTime pattern="MM/dd/yyyy" />
                                        </h:outputText>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="DataAtendimento"/>
                                        </f:facet>
                                        <h:outputText value="#{item.dataAtendimento}">
                                            <f:convertDateTime pattern="MM/dd/yyyy" />
                                        </h:outputText>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="DataFechamento"/>
                                        </f:facet>
                                        <h:outputText value="#{item.dataFechamento}">
                                            <f:convertDateTime pattern="MM/dd/yyyy" />
                                        </h:outputText>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="ClienteId"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.clienteId}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText escape="false" value="&nbsp;"/>
                                        </f:facet>
                                        <h:commandLink value="Exibir" action="#{manutencao.detailSetup}">
                                            <f:param name="jsfcrud.currentEntradaSaida" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][entradaSaida.entradaSaida][entradaSaida.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.currentManutencao" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][manutencao.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.relatedController" value="entradaSaida" />
                                            <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.EntradaSaidaController" />
                                        </h:commandLink>
                                        <h:outputText value=" "/>
                                        <h:commandLink value="Editar" action="#{manutencao.editSetup}">
                                            <f:param name="jsfcrud.currentEntradaSaida" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][entradaSaida.entradaSaida][entradaSaida.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.currentManutencao" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][manutencao.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.relatedController" value="entradaSaida" />
                                            <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.EntradaSaidaController" />
                                        </h:commandLink>
                                        <h:outputText value=" "/>
                                        <h:commandLink value="Remover" action="#{manutencao.destroy}">
                                            <f:param name="jsfcrud.currentEntradaSaida" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][entradaSaida.entradaSaida][entradaSaida.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.currentManutencao" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][manutencao.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.relatedController" value="entradaSaida" />
                                            <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.EntradaSaidaController" />
                                        </h:commandLink>
                                    </h:column>
                                </h:dataTable>
                            </h:panelGroup>
                        </c:if>
                        <c:if test="${not empty entradaSaida.entradaSaida.compraCollection}">
                            <h:outputText value="Compra:" />
                            <h:panelGroup>
                                <h:outputText rendered="#{empty entradaSaida.entradaSaida.compraCollection}" value="(No Items)"/>
                                <h:dataTable value="#{entradaSaida.entradaSaida.compraCollection}" var="item"
                                             border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px"
                                             rendered="#{not empty entradaSaida.entradaSaida.compraCollection}">
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="CompraId"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.compraId}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Observacao"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.observacao}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="DataCompra"/>
                                        </f:facet>
                                        <h:outputText value="#{item.dataCompra}">
                                            <f:convertDateTime pattern="MM/dd/yyyy" />
                                        </h:outputText>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="FuncionarioId"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.funcionarioId}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="VendedorId"/>
                                        </f:facet>
                                        <h:outputText value=" #{item.vendedorId}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText escape="false" value="&nbsp;"/>
                                        </f:facet>
                                        <h:commandLink value="Exibir" action="#{compra.detailSetup}">
                                            <f:param name="jsfcrud.currentEntradaSaida" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][entradaSaida.entradaSaida][entradaSaida.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.currentCompra" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][compra.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.relatedController" value="entradaSaida" />
                                            <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.EntradaSaidaController" />
                                        </h:commandLink>
                                        <h:outputText value=" "/>
                                        <h:commandLink value="Editar" action="#{compra.editSetup}">
                                            <f:param name="jsfcrud.currentEntradaSaida" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][entradaSaida.entradaSaida][entradaSaida.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.currentCompra" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][compra.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.relatedController" value="entradaSaida" />
                                            <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.EntradaSaidaController" />
                                        </h:commandLink>
                                        <h:outputText value=" "/>
                                        <h:commandLink value="Remover" action="#{compra.destroy}">
                                            <f:param name="jsfcrud.currentEntradaSaida" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][entradaSaida.entradaSaida][entradaSaida.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.currentCompra" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][compra.converter].jsfcrud_invoke}"/>
                                            <f:param name="jsfcrud.relatedController" value="entradaSaida" />
                                            <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.EntradaSaidaController" />
                                        </h:commandLink>
                                    </h:column>
                                </h:dataTable>
                            </h:panelGroup>
                        </c:if>
                    </h:panelGrid>
                </h:form>
            </div>
        </body>
    </html>
</f:view>
